Fix ppc-distribution docs for argument usage & correct test function (#366)#424
Conversation
There was a problem hiding this comment.
Pull request overview
This PR attempts to fix documentation and testing issues in the bayesplot package related to PPC distribution functions. The PR correctly identifies and fixes a test bug, and correctly updates the freq parameter documentation. However, it introduces critical inaccuracies in the documentation for binwidth, bins, and breaks parameters.
Changes:
- Fixed test function that incorrectly used
ppc_dens()instead ofppd_dens()for PPD function testing - Updated
freqparameter documentation to clarify it applies to frequency polygons in addition to histograms - Attempted to update
binwidth,bins, andbreaksparameter documentation (but with inaccuracies)
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/testthat/test-ppc-distributions.R | Correctly fixes test to use ppd_dens() instead of ppc_dens() when testing PPD versions |
| man-roxygen/args-hist-freq.R | Correctly updates freq parameter documentation to include frequency polygons |
| man-roxygen/args-hist.R | Attempts to document binwidth, bins, breaks for multiple geoms, but contains critical inaccuracies |
| man/*.Rd | Regenerated documentation files reflecting the changes in the templates |
| NEWS.md | Documents the changes made in this PR |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Address Copilot review feedback: - bins parameter now only mentions geom_histogram() and geom_area() - breaks parameter now only mentions geom_histogram() - Removed incorrect references to stat_dots() which doesn't support bins/breaks
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #424 +/- ##
==========================================
- Coverage 98.66% 98.63% -0.04%
==========================================
Files 35 35
Lines 5860 5860
==========================================
- Hits 5782 5780 -2
- Misses 78 80 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks, this looks good. The unit tests are failing on ubuntu-latest (devel) but sometimes this happens on r-devel. We have visual tests that compare SVGs and they are very sensitive. Nothing here should affect those, so we can merge this. |
Fixes #366
This PR addresses the documentation and testing issues in ppc-distribution:
Documentation improvements:
binwidth,bins, andbreaksarguments are passed toggplot2::geom_area()andggdist::stat_dots()in addition toggplot2::geom_histogram()freqargument applies to frequency polygons in addition to histogramsTest fix:
test-ppc-distributions.Rthat incorrectly usedppc_dens()instead ofppd_dens()when testing PPD versions of functionsTesting:
test-ppc-distributions.Rpass (111 PASS | 0 FAIL)